package user

import (
	"beego/testApp/common/db"
	"beego/testApp/common/tool"
	"fmt"
	"database/sql"
	_ "github.com/mattn/go-sqlite3"
	"strconv"
	"math"
	"time"
	//"encoding/json"
)

type ExamTpl struct {
    Eid  int     
	Tid  int  `orm:"pk;auto;column(tid)"`
	Tdes string
	Sort int
	Created time.Time 
}

func init(){

	tool.Pic("Examtpl  pakcage init"," init")
  
	orm.RegisterModel(new(ExamTpl))
}

func (t *ExamTpl) Add() bool {

	o := orm.NewOrm()
	o.Using("default")
	id,err  := o.Insert(t)
	
	if(err!=nil){
	   
		tool.Pic("Exam tpl add() insert into Db FAIL",err)
        return false
	} 

	tool.Pic("Examtpl  add() insert into db succsess ",id)

   return true

}
